package com.toivan.mt.model;

import java.util.Iterator;
import java.util.List;

public class MtDynamicStickerManager {

    private List<MtDynamicSticker> stickers;

    public List<MtDynamicSticker> getStickers() {
        return stickers;
    }

    public void setStickers(List<MtDynamicSticker> stickers) {
        this.stickers = stickers;
    }

    MtDynamicSticker findSticker(String name) {
        Iterator iterator = this.stickers.iterator();
        MtDynamicSticker sticker;
//        if (iterator.hasNext()) {
//            if (name.equals((sticker = (MtDynamicSticker) iterator.next()).getName())) {
//                return sticker;
//            }
//        }
        do {
            if (!iterator.hasNext()) {
                return null;
            }
        } while(!name.equals((sticker = (MtDynamicSticker) iterator.next()).getName()));

        return sticker;
    }
}
